<template>
  <el-submenu :key="data.id" v-if="data.children">
    <template slot="title">{{ data.title }}</template>
    <template v-for="d in data.children">
      <resub :key="d.id" :data="d"></resub>
    </template>
  </el-submenu>
  <el-menu-item :key="data.id" v-else>{{ data.title }}</el-menu-item>
</template>


<script>
import ElMenuItem from "./el-menu-item.vue";
import ElSubmenu from "./el-submenu.vue";
export default {
    
  name: "resub",
  props: {
    data: {
      type: Object,
      default: () => {},
    },
  },
  components:{
          ElMenuItem,
    ElSubmenu,
  }
};
</script>
